package com.ex.controller;

import com.ex.domain.ExceptionDomain;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


/**
 * @Author longdeng
 * @Date 2020/8/17 0017 22:45
 */
@Controller
@RequestMapping("/api/ex")
public class ExController {

    /**
     * 正常访问的页面信息
     *
     * @return
     */
    @RequestMapping("/index")
    public String index() {
        return "index";
    }

    /**
     * 空指针异常
     *
     * @return
     */
    @RequestMapping("/nullPointEx")
    public String nullPointEx(ExceptionDomain domain) {
        String aaa = null;
        if (aaa.equals("aaa")) {

        }
        return "index";
    }

    /**
     * 访问出现404页面
     *
     * @return
     */
    @RequestMapping("404")
    public String page404() {
        return "404";
    }

    /**
     * ajax请求信息
     *
     * @return
     */
    @RequestMapping("/ajaxRequest")
    @ResponseBody
    public String ajaxRequest() {
        String aaa = null;
        if (aaa.equals("aaa")) {

        }
        return "hello";
    }


}
